﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="ComputationVisualizer.CommonPaletteControl"
             >
	<UserControl.Resources>
		<Style x:Key="ButtonStyle2" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle">
				<Setter.Value>
					<Style>
						<Setter Property="Control.Template">
							<Setter.Value>
								<ControlTemplate>
									<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
								</ControlTemplate>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
								<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <CheckBox x:Name="commonPaletteCheckBox" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="0" Content="Общая палитра" Checked="commonPaletteCheckBox_Checked" Unchecked="commonPaletteCheckBox_Unchecked" />
        <WrapPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1" Orientation="Horizontal" Margin="5">
            <StackPanel>
                <Label Content="Минимальное значение"/>
                <TextBox x:Name="paletteMinValTB" Width="60"/>
            </StackPanel>
            <StackPanel>
                <Label Content="Максимальное значение"/>
                <TextBox x:Name="paletteMaxValTB" Width="60"/>
            </StackPanel>
            <StackPanel>
                <Label Content="Цвет минимума"/>
                <Button Width="25" Height="20" Background="Black" x:Name="paletteMinBtn"/>
            </StackPanel>
            <StackPanel>
                <Label Content="Цвет максимума"/>
                <Button Width="25" Height="20" Background="White" x:Name="paletteMaxBtn"/>
            </StackPanel>
            <Button x:Name="createCommonPaletteBtn" Content="Общая по всем кадрам" Margin="5" VerticalAlignment="Center" Click="createCommonPaletteBtn_Click" >
            </Button>
            <Button x:Name="createFramePaletteBtn" Content="Общая по текущему кадру" Margin="5" VerticalAlignment="Center" Click="createFramePaletteBtn_Click" />
        </WrapPanel>
    </Grid>
</UserControl>
